package com.tj.collection.controller.chatquality.response;

import com.tj.collection.db.domain.ChatterOnlineDto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.models.auth.In;
import lombok.Builder;
import lombok.Data;
import java.io.Serializable;

@ApiModel(value = "chatterOnlineVO", description = "chatter在线用户数列表")
@Data
@Builder
public class ChatterOnlineVO implements Serializable {

    @ApiModelProperty("chatter内码，页面不予显示")
    private String chatterUserCode;
    @ApiModelProperty("chatter账号")
    private String chatterAccount;
    @ApiModelProperty("chatter名称")
    private String chatterNickName;
    @ApiModelProperty("统计时间")
    private Integer queryDate;
    @ApiModelProperty("时段")
    private String timeStage;
    @ApiModelProperty("时段在线用户数")
    private Integer onlineUserCnt;
    @ApiModelProperty("显示标志：1-Abnormal 0-Normal")
    private Integer showWarningFlag;

    public static ChatterOnlineVO toVo(ChatterOnlineDto dto) {
        if (dto == null) {
            return null;
        }
        return ChatterOnlineVO.builder().chatterUserCode(dto.getChatterUserCode()).queryDate(dto.getQueryDate()).timeStage(dto.getTimeStage()).onlineUserCnt(dto.getOnlineUserCnt()).showWarningFlag(dto.getShowWarningFlag()).build();
    }
}
